﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BrokerBase.Lib.Policy
{
    /// <summary>
    /// 保障期假设
    /// </summary>
    public interface IPolicyPeriodActing
    {
        /// <summary>
        /// 管理方案的期间推演
        /// </summary>
        ISchemePeriodActing SchemePeriodActing { get; }
        /// <summary>
        /// 关联的保单的假设
        /// </summary>
        IPolicyActing PolicyActing { get; }

        int Period { get; }

        int Age { get; }

        int Year { get; }

        /// <summary>
        /// 是否在付款期内
        /// </summary>
        bool IsAtPaymentPeriod { get; }
        /// <summary>
        /// 是否在保险期限内
        /// </summary>
        bool IsAtInsurancePeriod { get; }
        /// <summary>
        /// 是否在计算期间内
        /// </summary>
        bool IsAtCalcPeriod { get; }
        /// <summary>
        /// 当期保额
        /// </summary>
        double Amount { get; set; }
        /// <summary>
        /// 保费
        /// </summary>
        double Fee { get; set; }
        /// <summary>
        /// 累计缴费
        /// </summary>
        double TotalFee { get; }
        /// <summary>
        /// 赔付/收益
        /// </summary>
        double Value { get; }
        /// <summary>
        /// 累计赔付/收益
        /// </summary>
        double TotalValue { get; }
        /// <summary>
        /// 本期扣减的费用
        /// </summary>
        double DeductionValue { get; }
        /// <summary>
        /// 累计扣减的费用
        /// </summary>
        double TotalDeductionValue { get; }
        /// <summary>
        /// 现金价值
        /// </summary>
        double? CashValue { get; set; }
        /// <summary>
        /// 保障的集合
        /// </summary>
        IDutyActing[] DutyActings { get;  }
        /// <summary>
        /// 是否在本期终止
        /// </summary>
        bool IsCurrentFinish { get; set; }

        void Calc();

        object Tag { get; set; }
        /// <summary>
        /// 获得一个保险利益已支付的总额
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        double GetDutyTotalValue(string name);

        bool IsLastPeriod { get; }

    }
}
